\documentclass[11pt,english,a4paper]{article}
\usepackage{babel}
\usepackage[utf8]{inputenc}
\usepackage{ae}
\usepackage[T1]{fontenc}
\usepackage{graphicx,latexsym,verbatim,varioref,epsfig,parskip}

\title{Xstar specification \\
\bigskip \begin{huge}Working Copy\end{huge}}

\author{Håvard Espeland \texttt{<haavares@ifi.uio.no>}\\Carl Henrik Lunde \texttt{<chlunde@ifi.uio.no>}}

\tolerance = 5000
\hbadness = \tolerance
\pretolerance = 2000

\begin{document}

\maketitle

\begin{abstract}
Xstar is a freely available, low bit rate, digital radio protocol suitable for
narrow band ham radio communication. Radio packets include mandatory call signs
for legal ham radio use under PTT\footnote{Post- og teletilsynet} (and hopefully
FCC) regulations. Only 5 Kbps is required to encode voice frames including
error correction codes.
\end{abstract}

\section{Overview}
\begin{description}
\item[Modulation] GMSK modulation, or optional QPSK modulation.
\item[Codec] Constant bit rate LPC10 2.4 Kbps vocoder or optional 13 Kbps GSM full rate
vocoder.
\item[Error Correction] Optional Reed-Solomon Forward Error Correction.
\item[Bit rate] 5 Kbps in voice mode, data mode not defined yet.
\item[Bandwidth] Currently unknown, but probably max a few KHz.
\end{description}

\section{Radio Packet}
\begin{figure}[!th]
\centering
\epsfig{file=radio_packet.eps,width=\columnwidth}
\caption{Xstar radio packet}
\end{figure}

An xstar radio packet consists of a synchronization part, radio header part,
and subframes, each explained in sections below. The radio packet's length is
unknown, and transmits continuously until explicitly torn down by and end of
packet subframe, or lost synchronization.

\subsection{Synchronization}
Two synchronization fields marks the start of a xstar packet. An
implementation of xstar should send 64 alternating bits starting with
\texttt{1010} as bit synchronization, followed by a 15 bit byte synchronization
field. The latter field should be hard coded to \texttt{111011001010000}.
If synchronization is lost at a later point, it can be regained by searching for
synchronization subframes (see below).

\subsection{Radio Header}
This part of the specification is not complete yet, but should include the sender
and expected receiver's call sign including transmission options.

\subsection{Subframes}
The xstar protocol specifies the following subframes with predefined lengths.

\begin{tabular}{|l|l|l|}
\hline
Type & Length & Description \\
\hline
0x30 & 63 B & Voice subframe \\
0x33 & 3 B & Synchronization subframe \\
0xff & 63 B & End subframe \\
\hline
\end{tabular}

Data frames encapsulating IP-packets should be defined in a similar manner, but
is not done yet. See later section for details on voice subframes.

\subsubsection{Synchronization subframe}
Synchronization frames contains the bit string
\texttt{001011001010100110001011}, and can be used to regain synchronization in
case of loss. The sender is required to send one of these at least every 10th
subframe. Failure to do so can result in the receiver prematurely assumes end
of packet. This subframe can be safely used as a NOP, i.e. in an underflow handler.

\subsubsection{End subframe}
This subframe marks the end of packet, and consists of a undecided bit sequence.

\subsection{Scrambling}
The radio header, and voice subframes are scrambled with a linear feedback shift
register. The initialization vector is currently undecided.

\section{Voice and data frames}
The preferred voice codec is selected in the radio header. Currently, LPC10 CBR
is the preferred codec, but GSM FR is also (partly) supported.

\subsection{LPC10 CBR Voice Subframes}
LPC10 frames are 20 ms long and 7 bytes large. In xstar, we pack 6 LPC10 frames
in the first 42 bytes of a voice frame. The remaining 21 bytes are Reed-Solomon
error correction codes, and can correct up to 10 byte errors in every voice
subframe. FEC is an optional feature.

\subsection{GSM FR Voice Subframes}
Not specified yet.

\end{document}
